<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Test20</title>
</head>
<body>
    <script type="text/javascript">
        var age = prompt("请输入您的年龄");
        if (age>=18){
            var a = '<img src="zw.jpg">';
            document.write(a);
        }else {
            alert("您的年龄太小");
        }
    </script>
</body>
</html>